#include "LogAppender.h"

namespace bamboo {

void StdoutLogAppender::log(LogEvent::ptr event) {
    std::cout << m_formatter->format(event) << std::endl;
}

FileLogAppender::FileLogAppender(const std::string& filename)
    : m_filename(filename) {
}

void FileLogAppender::reopen() {
    //if (m_filestream) {
        //m_filestream.close();
    //}
    //m_filestream.open(m_filename);
    //return !!m_filestream;
}

void FileLogAppender::log(LogEvent::ptr event) {
    //if (level > m_level) {
        //m_filestream << m_formatter.format(event);
    //}
    std::cout << m_formatter->format(event);
}

} // namespace bamboo